﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ScoreCounter : MonoBehaviour {

	public Image num1;
	public Image num2;
	public Image num3;
	public Image num4;
	public List<Sprite> imageList;
	[HideInInspector]
	public int currentScore;
	void Start () {
		currentScore = 0;
	}
	
	public void AddScore(int score){
		currentScore += score;
		int one = currentScore % 10;
		int two = currentScore % 100 / 10;
		int three = currentScore % 1000 / 100;
		int four = currentScore % 10000 / 1000;
		num1.sprite = imageList [one];
		num2.sprite = imageList [two];
		num3.sprite = imageList [three];
		num4.sprite = imageList [four];
	}
}
